// 客户管理
let baseName = '客户'
export const menu = {
    title: '客户',
    path: '/customer/index',
    name: 'customer',
    meta: {
        keepAlive: true
    },
    component: resolve => {
        require(['@/pages/index/index.vue'], resolve)
    },
    redirect: {
        name: 'customer.list'
    },
    children: [
        {
            title: '客户管理',
            path: '/customer/list',
            name: 'customer.list',
            meta: {
                keepAlive: true, //是否缓存页面
                breadcrumb: [baseName, '客户列表']
            },
            component: r => require.ensure([], () => r(require('@/pages/customer/index.vue')), 'customer.list')
        },
        {
            title: '添加客户',
            path: '/customer/add',
            name: 'customer.add',
            meta: {
                keepAlive: true, //是否缓存页面
                breadcrumb: [baseName, '添加客户']
            },
            component: r => require.ensure([], () => r(require('@/pages/customer/add/index.vue')), 'customer.add')
        }
    ]
}

// [业务演示] 路由设置
export const router = {
    ...menu,
    children: [].concat(...menu.children.map(e => e.children || e))
}